home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
126-150
/
scopedisk127
/
gshell
/
gshell1.3
/
gshell.doc
< prev
next >
Wrap
Text File
|
1995-03-19
|
22KB
|
491 lines
GShell - The CLI User's Directory Utility
Version 1.3
Copyright © 1990 Thomas Krehbiel
All Rights Reserved
Released May 15, 1990
+-----------------------------------------+
| NOTE: Requires Arp.library release 1.3! |
+-----------------------------------------+
This program is NOT public domain, but may be freely distributed as long as
1) No fee is charged for said distribution, except for reasonable media
costs, and 2) all files in the archive remain together. It is being
released "as is", with no warranty expressed or implied as to the use or
misuse of the program.
As this is the first released version, there ARE going to be bugs.
Instead of fuming about them, tell me about them and I will try to fix
them. Also, suggestions for improvements are also welcome, as long as
they fit somewhat within the program guidelines below.
Files in the archive:
GShell The program.
GShell.info And its icon.
GShell.pic A diagram of where all the gadgets are.
GShell.doc This document.
GShell.config Sample configuration file.
README Latest release notes.
REVISION HISTORY
~~~~~~~~~~~~~~~~
NOTE: Anything marked with a double-asterisk (**) denotes a new feature.
So if you're a GShell veteran, scan the revision list below, then
just search for "**" in your favorite editor to find the new stuff.
Version Date Comments
------- ----------- ---------------------------------------------------
1.3 14-May-90 Some bug fixes and new features from 1.2.
Went to using Arp's ASyncRun() for programs, fixing
a couple of bugs that cropped up on my system.
Added the StackSize specification for programs.
Can work with destination directory, now, too (!).
More new template args (see below).
Added the "H" gadget flag.
Changed meaning of the FLIP gadget.
1.2 05-May-90 Mostly Bug fixes to version 1.1.
Fixed a Parent Gadget bug.
Fixed "65575 directories" bug.
Fixed problem of quoting filenames with spaces.
Added new template args (see below).
Removed the %/ template arg (not necessary now).
Added the Debug configuration keyword.
1.1 01-May-90 First released to general public.
Now works from Workbench (good idea!).
Added a NOFILES gadget flag.
Various bug fixes.
1.0 15-Feb-90 Initial version (not released).
INTRODUCTION
~~~~~~~~~~~~
GShell, put simply, is another directory utility. Before you groan
and roll you eyes and delete it in disgust, though, read a little further.
I had been looking around the Amiga PD community for a directory
utility type of program that would suit my needs. What I did NOT need:
* I did NOT want to avoid using CLI (since I can type just fine).
* I did NOT want it to have so many gadgets that it was confusing.
* I did NOT want to be locked into the programmer's selection of
said gadgets.
* I did NOT want the program to be a million bytes long.
What I DID want:
* I wanted a program that was TOTALLY configurable.
* I wanted a program that had few built-in commands, but instead called
on external programs to do stuff like copying, renaming, etc. (because
I do use CLI a LOT, I have amassed a bunch of CLI programs that I like,
and why should my GShell do something these programs already do?).
* I wanted to have my choice of the information displayed about the
files.
So, in order to get the 'perfect' program, I wrote my own.
REQUIREMENTS
~~~~~~~~~~~~
This program requires Arp.library release 1.3. My reasons for
relying heavily on this library are: 1) It made programming a LOT
easier and faster; 2) I wanted to support the Arp 'movement';
3) WB 2.0 will undoubtedly have a library very much like it if and when
it is released.
If you do not have the library, then I STRONGLY urge you to get
it. It is probably available on a BBS near you. All you need is
the library, not the commands.
RUNNING GSHELL
~~~~~~~~~~~~~~
To run GShell from Workbench, just double-click its icon.
To run GShell from the CLI, use the following syntax:
1> GShell [sourceDir] [destDir]
where 'sourceDir' is an optional source directory, and 'destDir' is
an optional destination directory.
WHAT YOU SEE
~~~~~~~~~~~~
Since you have not defined a configuration file, you should see GShell come
up in its default state. Refer to the accompanying IFF diagram for where
the gadget positions are. Roughly in a clockwise order, here is the display:
Close Box Hmmm... If you don't this one by now...
Title Bar Tells whether you are currently viewing the Source
Directory, Destination Directory, or Volume List.
Depth Gadgets Another tough one, here.
Scroll Bar Scrolls through the list of filenames or devices. It
is an active scroll bar so you can drag it and see things
happening in the window.
Arrow Gadgets Same as the scroll bar, only one file at a time. They
repeat when you hold them down, too.
Directory Name The string gadget right in the middle holds the name of
the directory you're looking at. You can click here and
just type in a new directory if you want.
Parent Gadget The left-pointing arrow just to the left of the Directory
Name will attempt to move you to the parent of the
current directory.
SET Will highlight all files in the displayed directory.
RESET Will un-highlight all files in the displayed directory.
* FLIP This gadget's function has changed in GShell 1.3. Now
* it exchanges the Source and Destination directories (ie.
* the Source becomes the Destination and vice versa). Note
* that this is different from the action of the right mouse
* button.
BYTES Will calculate the number of bytes used in all highlighted
files and directories. It is recursive, so it will search
down through directory paths to find the size of all files
in all directory paths.
VOL Changes the display to the Volume/Device List display.
From this list you can double-click on any volume to
read it into the display.
Sizing Gadget Sometimes hidden down in the lower right is the window
sizing gadget. You can make the window bigger to display
more information about the files like date of creation,
protection bits, etc. Also making the window bigger allows
more files to be displayed in the file area.
SOURCE VS. DESTINATION DIRECTORIES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GShell has two directories you can access. The Source Directory is where
most of the action will probably take place. The Destination Directory is
usually only used for copying and moving files.
To toggle between the two directories, click the right mouse button once.
** As of version 1.3, GShell does not make as big of a distinction between the
** source and destination directories. In previous version, commands would
** only work on the source directory, but now you can work with either the
** source or the destination directory. For example, you can copy files from
** the source to the destination, switch to the destination directory with the
** right mouse button, then select some files and rename them (or whatever).
To enter a sub-directory on the display, just double-click on the
directory name.
CONFIGURATION
~~~~~~~~~~~~~
You will notice that there are no gadgets defined in the bottom portion
of the window. This is because you have not told GShell what you want to
put there. GShell has three types of gadgets: Internal Gadgets which are
hard-coded into the program (like the BYTES and VOL gadgets), User Volume
Gadgets, and User Program Gadgets.
GShell looks for a file called "S:GShell.Config" to read the configuration.
This file contains information about colors, default startup directories,
gadget meanings, and other things. Here is a sample configuration file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Sample configuration file for GShell.
Width 305
DefSource Work:
DefDest RAM:
CLIWindow NEWCON:0/11/640/189/MyWindow
; Row GadText Flags Program ArgTemp AskTemp MaxFiles
Gadget 1 DF0: V DF0:
Gadget 1 DF1: V DF1:
Gadget 2 Copy EDU C:Copy "%h %df" "" 0
Gadget 2 Del ESUF C:Delete "%h" "" 0
Gadget 2 Renam EASU C:Rename "%h %su" "Rename %f to?" 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notice that blank lines and lines beginning with semi-colons (;) are ignored
by GShell. Each line begins with a keyword, and is following by one or more
arguments for that keyword. Keywords may be upper or lower case, or any
combination thereof. Arguments must be seperated by at least one space or
tab, and any arguments that contain a space or tab must be enclosed in double
quotes ("). To insert a null arguments, use two double-quotes ("") as with
the Copy and Del gadgets in the above example.
Here is a list of the keywords that GShell recognizes:
Min/Max
KeyWord Args Description
------- -------- -----------------------------------------------
Gadget 4/7 Defines a User Volume or User Program gadget.
DefSource 1/1 Sets the default startup Source Directory.
DefDest 1/1 Sets the default startup Destination Directory.
LeftEdge 1/1 Sets the window's initial LeftEdge position.
TopEdge 1/1 Sets the window's initial TopEdge position.
Width 1/1 Sets the window's initial Width.
Height 1/1 Sets the window's initial Height.
CLIWindow 1/1 Defines the console window used for some commands.
FileTemp 1/1 Defines the template used to show filenames.
DirTemp 1/1 Defines the template used to show directories.
DevTemp 1/1 Defines the template used to show devices.
AsnTemp 1/1 Defines the template used to show assigns.
WBackPen 1/1 Pen number for window background (def BLUE).
LBackPen 1/1 Pen number for dir list background (def BLACK).
CBackPen 1/1 Pen for command background (def WHITE).
MBackPen 1/1 Pen for message background (def WHITE).
GBackPen 1/1 Pen for gadget background (def BLUE).
FilePen 1/1 Pen to render filenames (def WHITE).
DirPen 1/1 Pen to render directories (def BLUE).
DevPen 1/1 Pen to render devices (def WHITE).
AsnPen 1/1 Pen to render assigns (def WHITE).
UserPen 1/1 Pen to render user gadget names (def WHITE).
IntPen 1/1 Pen to render built-in gadget names (def BLACK).
LBordPen 1/1 Pen to render dir list border (def WHITE).
DBordPen 1/1 Pen to render dir name border (def BLACK).
GBordPen 1/1 Pen to render gadget borders (def BLACK).
FHighPen 1/1 Pen to highlight filenames (def RED).
DHighPen 1/1 Pen to highlight directoies (def RED).
VHighPen 1/1 Pen to highlight devices (def RED).
AHighPen 1/1 Pen to highlight assigns (def RED).
MsgPen 1/1 Pen to render messages (def BLACK).
Debug 0/0 Sends debugging information to CLI window.
KEYWORD: Gadget
~~~~~~~~~~~~~~~~
The Gadget keyword deserves further explanation. Here is the syntax of
the Gadget keyword:
GADGET <Row> <GadText> <Flags> <Program> [ArgTemp] [AskTemp] [MaxFiles] [StackSize]
Where:
Row This is the row number that the gadget will show up on,
starting with row number 1 being the row directly under
the built-in gadgets and working down.
GadText The text that will appear inside the gadget on the window.
Flags This defines what action takes place when the gadget is
pressed (see below). It is a string of characters, each
of which represents something to be done.
Program This is either the pathname of a program to run when the
gadget is clicked (for User Program Gadgets) or the
name of device to go to (for User Volume Gadgets), depending
on the Flags settings. For programs, it is best to specify
a full pathname (ie. "Sys:Tools/ShowANIM" as opposed to just
"ShowANIM").
ArgTemp This string specifies how the arguments for the command
are given (see below). It serves as a template, into
which highlighted filenames go, etc. If not specified,
then no arguments are used.
AskTemp This string is the template to use in asking the user
for information (see below). It can be left null ("") if
it is not required.
MaxFiles Specifies the maximum number of files that the Program
can accomodate in its command line.
** StackSize This specifies the stack size to use when running the
program. If you specify zero (0), then the default of
4096 is used. Otherwise, this should be an integer
between 0 and whatever (should be an even number, though).
This is useful for programs that need a BIG stack to run.
Gadget Templates
~~~~~~~~~~~~~~~~
Here is the format for the ArgTemp and AskTemp template strings. The format
is loosely based on the C Language printf() function, so if you are familiar
with that then you should pick this up pretty quickly. First, an example:
%h TO %D
This is the argument template string typically used for a Copy command.
GShell looks through the string for percent signs (%), which tell it to replace
this embedded command with a string. Here are the recognized embedded commands:
%h Replace with current highlighted pathname.
%f Replace with current highlighted filename only (not path).
%s Replace with name of source directory.
%d Replace with name of destination directory.
** %a Replace with name of ACTIVE directory (source or destination).
%u Replace with user input text from Ask.
%sf Replace with source directory + highlighted filename.
%df Replace with destination directory + highlighted filename.
** %af Replace with ACTIVE directory + highlighted filename.
%su Replace with source directory + user input text.
%du Replace with destination directory + user input text.
** %au Replace with ACTIVE directory + user input text.
%uq Replace with user input text and quote as a filename.
%% Used to insert a percent sign in the argument list.
So for the above example, if the filename highlighted is FooBar, the source
directory is DF0:Junk, and the destination directory is DF1:, here is what
GShell would do with the template "%h TO %D":
DF0:Junk/FooBar TO DF1:FooBar
Gadget Flags
~~~~~~~~~~~~
Here are the different flags available which define the type of gadget:
E If specified, will run the program once for each highlighted
filename. If not specified, then the program will only be
run once with all highlighted filenames (up to the maximum
set by MaxFiles) as the argument. This option is for commands
(like Copy) that only accept one filename as an argument.
S If specified, GShell will re-read the source directory after
all commands are finished. Useful if you are moving files
out of the source directory.
B Not implemented. Will run program as a background task.
C Create a CLI output window for the command. If not specified,
then all output goes to NIL: (oblivion) and some programs
might actually crash. This is useful for programs like Info
that send the info to the CLI window.
A Ask user for information. Will pop up a requester with the
AskTemp string as the question and wait for a string gadget
response from the user.
O If this is specified, then the Ask requester (if specified)
will only appear once at the beginning of a (possibly) long
list of highlighted filenames. If not specified, then the
Ask requester will pop up for each and every highlighted
filename.
F Ask user for verification before doing the operation. Puts
up a requester saying "Are you sure?" before proceeding.
You'd usually want to do this for a delete operation, I would
think.
V This tells GShell that this gadget is really a User Volume
Gadget. If this is the case, then the ProgramName is
actually the name of a device which GShell will make the
current directory when this gadget is clicked.
U If set, GShell will unhighlight each highlighted file that
is used after the command is finished. Otherwise, files
will remain highlighted.
D If specified, GShell will re-read the destination directory
once the operation is finished. This would be useful for
copy or move type of commands, or anytime the destination
is modified.
W This will tell GShell to put a "Press RETURN To Continue" message
in a CLI window before closing it so that the user can see
the output from the command at his leisure.
N This tells GShell that this gadget does not need any files
highlighted in order to work. Normally if no files are
highlighted, GShell will complain. But not so with this
handy-dandy flag.
** H Tells GShell to re-read either the Source or the Destination
directories, depending on which is currently active. That is,
it will re-read the active directory when the operation is
finished.
KEYWORDS: FileTemp, DirTemp, DevTemp, AsnTemp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Another area where GShell may be configured is in what is displayed in
the file area. Four user-definable templates are used to determine this, and
are specified with the FileTemp, DirTemp, DevTemp, and AsnTemp keywords and
affect filename entries, directory entries, device entries, and assign entries
respectively.
These templates are similar in format to the Gadget Templates, above
only they use different embedded commands. Here is a list of the ones GShell
currently recognizes:
%e Filename, directory name, device name, or assigned name [25].
%b Number of bytes in a file only [7].
%y Day of file or directory creation (Mon, Tue, etc.) [3].
%t1 Time in format HH:MM (24 hour) [5].
%t2 Time in format HH:MMa (12 hour) [6].
%t3 Time in format HH:MM:SS (24 hour) [8].
%t4 Time in format HH:MM:SSa (12 hour) [9].
%d1 Date in format DD/MM/YY [8].
%d2 Date in format MM/DD/YY [8].
%d3 Date in format DD-Mon-YY [9].
%p Protection bits for files or directories [8].
%a Physical path to a logical assigned name [40].
NOTE: Using the "%a" option slows things down considerably.
NOTE: The number in brackets is the number of character positions that
that particular option uses.
Here is a list of the four default templates:
FileTemp "%e %b %p %y %d1 %t2"
DirTemp "%e [DIR] %p %y %d1 %t2"
DevTemp "%e [DEV]"
AsnTemp "%e [ASSGN]"
KEYWORD: Debug
~~~~~~~~~~~~~~~
This allows you to find out exactly what GShell is trying to do when
you select a gadget. If you run GShell from the CLI, and you specify this
keyword, then GShell will print the exact string it is trying to execute to
the CLI window before it attempts executes it. This is useful to see if you
have built your argument template correctly. Note that this option is
currently useless from Workbench.
CONCLUSION
~~~~~~~~~~
Look at the supplied sample Config file (GShell.Config) for examples
of most all of the above templates, keywords, etc. You can just modify this
one to correct for your own paths and programs and copy to your S: directory
to use.
There are a few things I would like to do to this program in the future,
like add an Arexx port, be able to use a custom screen with interlace, add
keyboard equivalents for gadgets, and some other junk.
Hope this program finds a use someplace. Have fun with it!
THE AUTHOR
~~~~~~~~~~
Thomas Krehbiel
10747 Surry Road
Chester, VA 23831
I can also be reached on the Amiga Blues BBS (804-796-3631) as
"Tom Krehbiel". The Blues has now become a pay BBS ($10/year), but it is
well worth the money (your welcome, Jake!).
Tom